package com.TeaManage.bean;

public class OrderItem {
    private Integer item_id;  // 修改为与数据库一致的字段名
    private Integer order_id;
    private Integer tea_id;
    private Double quantity;
    private Double unit_price;
    private Double subtotal;
    private Tea tea; // 用于显示茶叶信息
    private String tea_name;
    private String unit; // 茶叶单位


    public OrderItem() {
    }

    public OrderItem(Integer item_id, Integer order_id, Integer tea_id, Double quantity, Double unit_price, Double subtotal, Tea tea, String tea_name, String unit) {
        this.item_id = item_id;
        this.order_id = order_id;
        this.tea_id = tea_id;
        this.quantity = quantity;
        this.unit_price = unit_price;
        this.subtotal = subtotal;
        this.tea = tea;
        this.tea_name = tea_name;
        this.unit = unit;
    }

    /**
     * 获取
     * @return item_id
     */
    public Integer getItem_id() {
        return item_id;
    }

    /**
     * 设置
     * @param item_id
     */
    public void setItem_id(Integer item_id) {
        this.item_id = item_id;
    }

    /**
     * 获取ID (兼容性方法)
     * @return item_id
     */
    public Integer getId() {
        return item_id;
    }

    /**
     * 设置ID (兼容性方法)
     * @param id
     */
    public void setId(Integer id) {
        this.item_id = id;
    }

    /**
     * 获取
     * @return order_id
     */
    public Integer getOrder_id() {
        return order_id;
    }

    /**
     * 设置
     * @param order_id
     */
    public void setOrder_id(Integer order_id) {
        this.order_id = order_id;
    }

    /**
     * 获取
     * @return tea_id
     */
    public Integer getTea_id() {
        return tea_id;
    }

    /**
     * 设置
     * @param tea_id
     */
    public void setTea_id(Integer tea_id) {
        this.tea_id = tea_id;
    }

    /**
     * 获取
     * @return quantity
     */
    public Double getQuantity() {
        return quantity;
    }

    /**
     * 设置
     * @param quantity
     */
    public void setQuantity(Double quantity) {
        this.quantity = quantity;
    }

    /**
     * 获取
     * @return unit_price
     */
    public Double getUnit_price() {
        return unit_price;
    }

    /**
     * 设置
     * @param unit_price
     */
    public void setUnit_price(Double unit_price) {
        this.unit_price = unit_price;
    }

    /**
     * 获取
     * @return subtotal
     */
    public Double getSubtotal() {
        return subtotal;
    }

    /**
     * 设置
     * @param subtotal
     */
    public void setSubtotal(Double subtotal) {
        this.subtotal = subtotal;
    }

    /**
     * 获取
     * @return tea
     */
    public Tea getTea() {
        return tea;
    }

    /**
     * 设置
     * @param tea
     */
    public void setTea(Tea tea) {
        this.tea = tea;
    }

    /**
     * 获取
     * @return tea_name
     */
    public String getTea_name() {
        return tea_name;
    }

    /**
     * 设置
     * @param tea_name
     */
    public void setTea_name(String tea_name) {
        this.tea_name = tea_name;
    }

    /**
     * 获取
     * @return unit
     */
    public String getUnit() {
        return unit;
    }

    /**
     * 设置
     * @param unit
     */
    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String toString() {
        return "OrderItem{item_id = " + item_id + ", order_id = " + order_id + ", tea_id = " + tea_id + ", quantity = " + quantity + ", unit_price = " + unit_price + ", subtotal = " + subtotal + ", tea = " + tea + ", tea_name = " + tea_name + ", unit = " + unit + "}";
    }
}
